<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Login Page</title>
</head>
<body>
<div th:if="${success}" th:text="${success}"></div>
<div th:if="${error}" th:text="${error}"></div>
<form action="/userlogin1" method="post" th:object="${user}"> <!-- 确保表单的action和method正确 -->
  账号：<input type="text" name="username" th:field="*{name}"> <!-- 确保th:field语法正确 -->
  密码：<input type="password" name="password" th:field="*{password}"> <!-- 确保th:field语法正确 -->
  性别：<input type="text" name="sex" th:field="*{sex}"> <!-- 确保th:field语法正确 -->
  <input type="submit" value="登录">
</form>
</body>
</html>